#!/bin/bash

# packet all need file
# create temp dirs

if [ -d ./gss ]; then 
	rm -rf gss
fi
if [ -d ./netinput ]; then 
	rm -rf netinput
fi

# ->gss
mkdir gss

# ->gss
#    |- bin
#    |- config
#    |- lib
#    |- movies
cd gss
mkdir bin config movies

# ->gss
#    |- movies
#    |- config
#    |- bin
#        |-linux
cd bin
mkdir linux

#->gss
#	|- movies
#	|- config
#	|- bin
#		|-linux

#return to gss dir
cd ../..

#copy files
cp ../project/MediaAdapter_linux/libnetinput.so gss/bin/linux/
cp ../config/config.xml gss/config/
mv gss netinput
echo "create netinput packet"
tar -czvf netinput.tar.gz netinput

cp -rf ../test/mmclient .
rm -rf mmclient/.svn

mv netinput gss
cp run.sh gss/bin/linux
cp ../project/linux/gss gss/bin/linux/
cp ../project/linux/license.cer gss/bin/linux

rm -rf gss/bin/linux/libnetinput.so
#packet
echo "create gss packet"
tar -czvf gss.tar.gz gss
echo "create mmclient packet"
tar -czvf mmclient.tar.gz mmclient

#remove dir
rm -rf gss netinput
rm -rf mmclient
